#pragma once

#include <SDL.h>
#include <functional>
#include <vector>

class Application;

class Input
{
	using KeyDownCallback = std::function<bool(SDL_Keycode)>;
	using ScanKeyCallback = std::function<void(const Uint8* keymap, int len)>;
public:
	static Input& getInstance()
	{
		static Input input;
		return input;
	}

	void update();

	void addKeyDownCallback(KeyDownCallback func);
	void addScanKeyCallback(ScanKeyCallback func);

private:
	std::vector<KeyDownCallback> keyDownCallbacks;
	std::vector<ScanKeyCallback> scanKeyCallbacks;
};

